package org.jeecg.modules.mes.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.modules.mes.entity.MesProductionPlan;
import org.jeecg.modules.mes.entity.MesProductionPlanOrderDetail;
import org.jeecg.modules.mes.entity.MesProductionPlanTask;
import org.jeecg.modules.mes.entity.MesTaskParticipant;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: 生产计划详情VO（包含订单明细和任务参与者）
 * @Author: jeecg-boot
 * @Date: 2025-08-30
 * @Version: V2.0
 */
@Data
@ApiModel(value="MesProductionPlanDetailVO", description="生产计划详情VO")
public class MesProductionPlanDetailVO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**生产计划基本信息*/
    @ApiModelProperty(value = "生产计划基本信息")
    private MesProductionPlan planInfo;

    /**设置计划信息*/
    public void setPlan(MesProductionPlan plan) {
        this.planInfo = plan;
    }

    /**关联的订单明细列表*/
    @ApiModelProperty(value = "关联的订单明细列表")
    private List<MesProductionPlanOrderDetail> orderDetails;

    /**任务列表（包含参与者信息）*/
    @ApiModelProperty(value = "任务列表（包含参与者信息）")
    private List<TaskWithParticipantsVO> tasks;

    /**订单明细总数*/
    @ApiModelProperty(value = "订单明细总数")
    private Integer totalOrderDetails;

    /**任务总数*/
    @ApiModelProperty(value = "任务总数")
    private Integer totalTasks;

    /**参与者总数*/
    @ApiModelProperty(value = "参与者总数")
    private Integer totalParticipants;

    @Data
    @ApiModel(value="TaskWithParticipantsVO", description="任务及参与者VO")
    public static class TaskWithParticipantsVO implements Serializable {
        private static final long serialVersionUID = 1L;

        /**任务基本信息*/
        @ApiModelProperty(value = "任务基本信息")
        private MesProductionPlanTask taskInfo;

        /**参与者列表*/
        @ApiModelProperty(value = "参与者列表")
        private List<MesTaskParticipant> participants;

        /**任务统计信息*/
        @ApiModelProperty(value = "任务统计信息")
        private TaskStatsVO stats;
    }

    @Data
    @ApiModel(value="TaskStatsVO", description="任务统计VO")
    public static class TaskStatsVO implements Serializable {
        private static final long serialVersionUID = 1L;

        /**总参与人数*/
        @ApiModelProperty(value = "总参与人数")
        private Integer totalParticipants;

        /**已完成人数*/
        @ApiModelProperty(value = "已完成人数")
        private Integer completedParticipants;

        /**总完成数量*/
        @ApiModelProperty(value = "总完成数量")
        private Integer totalCompletedQuantity;

        /**完成进度百分比*/
        @ApiModelProperty(value = "完成进度百分比")
        private Double progressPercentage;

        /**平均质量评分*/
        @ApiModelProperty(value = "平均质量评分")
        private Double avgQualityScore;

        /**平均效率评分*/
        @ApiModelProperty(value = "平均效率评分")
        private Double avgEfficiencyScore;
    }
}
